package com.dc.controller;

import com.dc.annotation.Log;
import com.dc.common.ResponseResultVO;
import com.dc.entity.ro.WorkDetailsRO;
import com.dc.service.WorkDetailsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Api(tags = "维保项目字典管理")
@RestController
@RequestMapping("/workDetails")
public class WorkDetailsController {

    @Resource
    private WorkDetailsService workDetailsService;


    @Log(title = "维保项目字典管理", businessDesc = "增加")
    @ApiOperation(value = "增加", notes = "增加")
    @PostMapping("/insertWorkDetails")
    public ResponseResultVO insertWorkDetails(@RequestBody WorkDetailsRO ro) {
        return workDetailsService.insertWorkDetails(ro);
    }


    @Log(title = "维保项目字典管理", businessDesc = "修改")
    @ApiOperation(value = "修改", notes = "修改")
    @PostMapping("/updateWorkDetails")
    public ResponseResultVO updateWorkDetails(@RequestBody WorkDetailsRO ro) {
        return workDetailsService.updateWorkDetails(ro);
    }


    @Log(title = "维保项目字典管理", businessDesc = "删除")
    @ApiOperation(value = "删除", notes = "删除")
    @GetMapping("/deleteWorkDetails")
    public ResponseResultVO deleteWorkDetails(@RequestParam String id) {
        return workDetailsService.deleteWorkDetails(id);
    }

    @ApiOperation(value = "分页查询列表", notes = "分页查询列表")
    @PostMapping("/selectWorkDetailsByPage")
    public ResponseResultVO selectWorkDetailsByPage(@RequestBody WorkDetailsRO ro) {
        return workDetailsService.selectWorkDetailsByPage(ro);
    }

    @ApiOperation(value = "维保项目下拉", notes = "维保项目下拉")
    @GetMapping("/selectWorkDetailsList")
    public ResponseResultVO selectWorkDetailsList() {
        return workDetailsService.selectWorkDetailsList();
    }
}
